package com.three.Service.ServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.three.Mapper.CollageMapper;
import com.three.Pojo.Collage;
import com.three.Service.ICollageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class CollageServiceImpl implements ICollageService {

    @Autowired
    private CollageMapper collageMapper;
    @Override
    public void addsave(Collage collage) {
        collageMapper.addsave(collage);
    }

    @Override
    public PageInfo<Collage> findlist(Integer pageNum, Integer pageSize, String collageName) {
        PageHelper.startPage(pageNum,pageSize);
        List<Collage> collageList=collageMapper.findcollagelist(collageName);
        PageInfo<Collage> pageInfo=new PageInfo<>(collageList);
        return pageInfo;
    }

    @Override
    public Collage findByid(Integer id) {
        return collageMapper.findByid(id);
    }

    @Override
    public void updatesave(Collage collage) {
        collageMapper.updatesave(collage);
    }

    @Override
    public void delete(Integer id) {
        collageMapper.delete(id);
    }




}
